﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="catalogTipsJardin.aspx.cs"
    Inherits="catalogTipsJardin" EnableEventValidation="false" ValidateRequest="false" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Catalogo Tips Jardin</title>
    <style type="text/css">
        .fontLabel
        {
            font-family: Calibri;
            font-size: medium;
        }
        .textField
        {
            padding-left: 15px;
        }
        .buttonExtNet
        {
            height: 22px;
            vertical-align: bottom;
        }
    </style>
    <script type="text/javascript">
      
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManagerCatalog" runat="server" />
        <ext:Viewport ID="ViewPortSite" runat="server" Layout="FitLayout">
            <Items>
                <ext:Panel ID="Panel1" Layout="FitLayout" runat="server">
                    <Items>
                        <ext:Panel ID="pnlTipsJardin" runat="server" Icon="Application" Border="false" Header="false"
                            Closable="false" AutoHeight="true" AutoScroll="true">
                            <Items>
                                <ext:FormPanel ID="pnlTipsJardinCatalog" runat="server" Title="Catalogo Tips Jardin"
                                    Icon="Newspaper" DefaultAnchor="100%" BodyPadding="5">
                                    <Items>
                                        <ext:FieldSet ID="FieldSet1" runat="server">
                                            <Items>
                                                <ext:FieldContainer ID="fieldcontainer2" runat="server" Layout="HBoxLayout" Margin="10">
                                                    <Items>
                                                        <ext:TextField ID="txtCategory" runat="server" FieldLabel="Categoria" Name="Category"
                                                            AllowBlank="false" />
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="fieldcontainer1" runat="server" Layout="HBoxLayout" Margin="10">
                                                    <Items>
                                                        <ext:TextField ID="txtTitle" runat="server" FieldLabel="Titulo" Name="Title" AllowBlank="false" />
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="fieldcontainer4" runat="server" Layout="HBoxLayout" Margin="10">
                                                    <Items>
                                                        <ext:HtmlEditor ID="htmlContent" runat="server" FieldLabel="Contenido" Name="Content"
                                                            LabelAlign="Top" Height="350" Margin="5" Width="560" />
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="fieldcontainer5" runat="server" Layout="HBoxLayout" Margin="10">
                                                    <Items>
                                                        <ext:Button ID="btnAdd" runat="server" Text="Agregar">
                                                            <DirectEvents>
                                                                <Click OnEvent="AddClick" Before="if (!#{pnlTipsJardinCatalog}.getForm().isValid()) { return false; }">
                                                                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{pnlTipsJardin}.body}" />
                                                                </Click>
                                                            </DirectEvents>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="fieldcontainer3" runat="server">
                                                    <Items>
                                                        <ext:GridPanel ID="gridContents" runat="server" ClientIDMode="Static" AutoHeight="true"
                                                            Border="true">
                                                            <Store>
                                                                <ext:Store ID="storeContents" runat="server" FilterOnLoad="false" PageSize="10" OnReadData="Store1_RefreshData">
                                                                    <Model>
                                                                        <ext:Model ID="Model5" runat="server" IDProperty="Id">
                                                                            <Fields>
                                                                                <ext:ModelField Name="Id" />
                                                                                <ext:ModelField Name="Category" />
                                                                                <ext:ModelField Name="Title" />                                                                                
                                                                            </Fields>
                                                                        </ext:Model>
                                                                    </Model>
                                                                </ext:Store>
                                                            </Store>
                                                            <ColumnModel>
                                                                <Columns>
                                                                    <ext:TemplateColumn ID="TemplateColumn1" runat="server" Text="Imagen" Flex="15" DataIndex="url"
                                                                        TemplateString='<img style="width:19px;height:22px;" src="../Images/leaftip.png" />' />
                                                                    <ext:Column ID="Column1" runat="server" Text="Id" Flex="35" DataIndex="Id" />
                                                                    <ext:Column ID="Column2" runat="server" Text="Categoria" Flex="35" DataIndex="Category" />
                                                                    <ext:Column ID="Column3" runat="server" Text="Titulo" Flex="35" DataIndex="Title" />
                                                                </Columns>
                                                            </ColumnModel>
                                                            <Features>
                                                                <ext:GridFilters Enabled="false">
                                                                </ext:GridFilters>
                                                            </Features>
                                                            <View>
                                                                <ext:GridView ID="GridView2" runat="server" EmptyText="Sin registros para mostrar" />
                                                            </View>
                                                            <SelectionModel>
                                                                <ext:RowSelectionModel ID="RowSelectionModelHome" runat="server" Mode="Single" />
                                                            </SelectionModel>
                                                            <BottomBar>
                                                                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10">
                                                                </ext:PagingToolbar>
                                                            </BottomBar>
                                                            <Buttons>
                                                                <ext:Button ID="btnDelete" runat="server" Text="Eliminar">
                                                                    <DirectEvents>
                                                                        <Click OnEvent="btnDelete_Click">
                                                                            <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{pnlTipsJardin}.body}" />
                                                                            <ExtraParams>
                                                                                <ext:Parameter Name="idValues" Value="Ext.encode(#{gridContents}.getRowsValues({selectedOnly : true}))"
                                                                                    Mode="Raw" />
                                                                            </ExtraParams>
                                                                        </Click>
                                                                    </DirectEvents>
                                                                </ext:Button>
                                                            </Buttons>
                                                        </ext:GridPanel>
                                                    </Items>
                                                </ext:FieldContainer>
                                            </Items>
                                        </ext:FieldSet>
                                    </Items>
                                </ext:FormPanel>
                            </Items>
                        </ext:Panel>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
